<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMaterialLibraryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('material_library', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('上传人ID');
            $table->integer('company_id')->comment('公司ID');
            $table->string('old_name',255)->comment('原文件名');
            $table->string('new_name',255)->comment('新生成的文件名');
            $table->string('url',255)->comment('图片路经');
            $table->tinyInteger('status')->default(0)->comment('是否删除 1：是 0：否');
            $table->tinyInteger('type')->comment('1:大图，2:小图，3:内容图');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `material_library` comment '素材库表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('material_library');
    }
}
